/*
 * ColorPalette.java  0.4.0 / Oct 25, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
package com.cute4j.swing.styles; // NOPMD

import com.cute4j.swing.graphics.Color;
import com.cute4j.util.Utilities;

/**
 * Color Palette.
 *
 * @author Slobodan Vrkacevic
 * @version 0.4.0
 */
public abstract class ColorPalette {

// Public Methods. -------------------------------------------------------------

  /**
   * Returns the name of the color palette.
   *
   * @return the name of the color palette
   */
  public abstract String getName();

  /**
   * Returns the active background color.
   *
   * @return the active background color
   */
  public abstract Color getActiveBackgroundColor();

  /**
   * Returns the inactive background color.
   *
   * @return the inactive background color
   */
  public abstract Color getInactiveBackgroundColor();

  /**
   * Returns the disabled background color.
   *
   * @return the disabled background color
   */
  public abstract Color getDisabledBackgroundColor();

  /**
   * Returns the active foreground color.
   *
   * @return the active foreground color
   */
  public abstract Color getActiveForegroundColor();

  /**
   * Returns the inactive foreground color.
   *
   * @return the inactive foreground color
   */
  public abstract Color getInactiveForegroundColor();

  /**
   * Returns the disabled foreground color.
   *
   * @return the disabled foreground color
   */
  public abstract Color getDisabledForegroundColor();

  /**
   * Returns the active background color for text entry components.
   *
   * @return the active background color for text entry components color
   */
  public abstract Color getActiveBaseColor();

  /**
   * Returns the inactive background color for text entry components.
   *
   * @return the inactive background color for text entry components color
   */
  public abstract Color getInactiveBaseColor();

  /**
   * Returns the disabled background color for text entry components.
   *
   * @return the disabled background color for text entry components color
   */
  public abstract Color getDisabledBaseColor();

  /**
   * Returns the active alternate background color in views with alternating row
   *         colors.
   *
   * @return the active alternate background color in views with alternating row
   *         colors.
   */
  public abstract Color getActiveAlternateBaseColor();

  /**
   * Returns the inactive alternate background color in views with alternating
   *         row colors.
   *
   * @return the inactive alternate background color in views with alternating
   *         row colors.
   */
  public abstract Color getInactiveAlternateBaseColor();

  /**
   * Returns the disabled alternate background color in views with alternating
   *         row colors.
   *
   * @return the disabled alternate background color in views with alternating
   *         row colors.
   */
  public abstract Color getDisabledAlternateBaseColor();

  /**
   * Returns the active foreground color used with Base color.
   *
   * @return the active foreground color used with Base color
   */
  public abstract Color getActiveTextColor();

  /**
   * Returns the inactive foreground color used with Base color.
   *
   * @return the inactive foreground color used with Base color
   */
  public abstract Color getInactiveTextColor();

  /**
   * Returns the disabled foreground color used with Base color.
   *
   * @return the disabled foreground color used with Base color
   */
  public abstract Color getDisabledTextColor();

  /**
   * Returns the active button background color.
   *
   * @return the active button background color
   */
  public abstract Color getActiveButtonColor();

  /**
   * Returns the inactive button background color.
   *
   * @return the inactive button background color
   */
  public abstract Color getInactiveButtonColor();

  /**
   * Returns the disabled button background color.
   *
   * @return the disabled button background color
   */
  public abstract Color getDisabledButtonColor();

  /**
   * Returns the active button foreground color.
   *
   * @return the active button foreground color
   */
  public abstract Color getActiveButtonTextColor();

  /**
   * Returns the inactive button foreground color.
   *
   * @return the inactive button foreground color
   */
  public abstract Color getInactiveButtonTextColor();

  /**
   * Returns the disabled button foreground color.
   *
   * @return the disabled button foreground color
   */
  public abstract Color getDisabledButtonTextColor();

  /**
   * Returns the active bright text color.
   *
   * @return the active bright text color
   */
  public abstract Color getActiveBrightTextColor();

  /**
   * Returns the inactive bright text color.
   *
   * @return the inactive bright text color
   */
  public abstract Color getInactiveBrightTextColor();

  /**
   * Returns the disabled bright text color.
   *
   * @return the disabled bright text color
   */
  public abstract Color getDisabledBrightTextColor();

  /**
   * Returns the active light color.
   *
   * @return the active light color
   */
  public abstract Color getActiveLightColor();

  /**
   * Returns the inactive light color.
   *
   * @return the inactive light color
   */
  public abstract Color getInactiveLightColor();

  /**
   * Returns the disabled light color.
   *
   * @return the disabled light color
   */
  public abstract Color getDisabledLightColor();

  /**
   * Returns the active midlight color.
   *
   * @return the active midlight color
   */
  public abstract Color getActiveMidlightColor();

  /**
   * Returns the inactive midlight color.
   *
   * @return the inactive midlight color
   */
  public abstract Color getInactiveMidlightColor();

  /**
   * Returns the disabled midlight color.
   *
   * @return the disabled midlight color
   */
  public abstract Color getDisabledMidlightColor();

  /**
   * Returns the disabled active dark color.
   *
   * @return the disabled active dark color
   */
  public abstract Color getActiveDarkColor();

  /**
   * Returns the inactive dark color.
   *
   * @return the inactive dark color
   */
  public abstract Color getInactiveDarkColor();

  /**
   * Returns the disabled dark color.
   *
   * @return the disabled dark color
   */
  public abstract Color getDisabledDarkColor();

  /**
   * Returns the active mid color.
   *
   * @return the active mid color
   */
  public abstract Color getActiveMidColor();

  /**
   * Returns the inactive mid color.
   *
   * @return the inactive mid color
   */
  public abstract Color getInactiveMidColor();

  /**
   * Returns the disabled mid color.
   *
   * @return the disabled mid color
   */
  public abstract Color getDisabledMidColor();

  /**
   * Returns the active shadow color.
   *
   * @return the active shadow color
   */
  public abstract Color getActiveShadowColor();

  /**
   * Returns the inactive shadow color.
   *
   * @return the inactive shadow color
   */
  public abstract Color getInactiveShadowColor();

  /**
   * Returns the disabled shadow color.
   *
   * @return the disabled shadow color
   */
  public abstract Color getDisabledShadowColor();

  /**
   * Returns the active highlight color.
   *
   * @return the active highlight color
   */
  public abstract Color getActiveHighlightColor();

  /**
   * Returns the inactive highlight color.
   *
   * @return the inactive highlight color
   */
  public abstract Color getInactiveHighlightColor();

  /**
   * Returns the disabled highlight color.
   *
   * @return the disabled highlight color
   */
  public abstract Color getDisabledHighlightColor();

  /**
   * Returns the active highlighted text color.
   *
   * @return the active highlighted text color
   */
  public abstract Color getActiveHighlightedTextColor();

  /**
   * Returns the inactive highlighted text color.
   *
   * @return the inactive highlighted text color
   */
  public abstract Color getInactiveHighlightedTextColor();

  /**
   * Returns the disabled highlighted text color.
   *
   * @return the disabled highlighted text color
   */
  public abstract Color getDisabledHighlightedTextColor();

  /**
   * Returns the active link color.
   *
   * @return the active link color
   */
  public abstract Color getActiveLinkColor();

  /**
   * Returns the inactive link color.
   *
   * @return the inactive link color
   */
  public abstract Color getInactiveLinkColor();

  /**
   * Returns the disabled link color.
   *
   * @return the disabled link color
   */
  public abstract Color getDisabledLinkColor();

  /**
   * Returns the active visited link color.
   *
   * @return the active visited link color
   */
  public abstract Color getActiveLinkVisitedColor();

  /**
   * Returns the inactive visited link color.
   *
   * @return the inactive visited link color
   */
  public abstract Color getInactiveLinkVisitedColor();

  /**
   * Returns the disabled visited link color.
   *
   * @return the disabled visited link color
   */
  public abstract Color getDisabledLinkVisitedColor();

// Overridden Methods. ---------------------------------------------------------

  /**
   * {@inheritDoc}
   */
  public boolean equals(Object obj) { // NOPMD
    if (obj == this) {
      return true;
    }
    if ((obj != null) && (obj.getClass() == getClass())) {
      ColorPalette cp = (ColorPalette)obj;
      return (Utilities.equals(getName(), cp.getName()) &&
              Utilities.equals(getActiveBackgroundColor(),
                               cp.getActiveBackgroundColor()) &&
              Utilities.equals(getInactiveBackgroundColor(),
                               cp.getInactiveBackgroundColor()) &&
              Utilities.equals(getDisabledBackgroundColor(),
                               cp.getDisabledBackgroundColor()) &&
              Utilities.equals(getActiveForegroundColor(),
                               cp.getActiveForegroundColor()) &&
              Utilities.equals(getInactiveForegroundColor(),
                               cp.getInactiveForegroundColor()) &&
              Utilities.equals(getDisabledForegroundColor(),
                               cp.getDisabledForegroundColor()) &&
              Utilities.equals(getActiveBaseColor(),
                               cp.getActiveBaseColor()) &&
              Utilities.equals(getInactiveBaseColor(),
                               cp.getInactiveBaseColor()) &&
              Utilities.equals(getDisabledBaseColor(),
                               cp.getDisabledBaseColor()) &&
              Utilities.equals(getActiveAlternateBaseColor(),
                               cp.getActiveAlternateBaseColor()) &&
              Utilities.equals(getInactiveAlternateBaseColor(),
                               cp.getInactiveAlternateBaseColor()) &&
              Utilities.equals(getDisabledAlternateBaseColor(),
                               cp.getDisabledAlternateBaseColor()) &&
              Utilities.equals(getActiveTextColor(),
                               cp.getActiveTextColor()) &&
              Utilities.equals(getInactiveTextColor(),
                               cp.getInactiveTextColor()) &&
              Utilities.equals(getDisabledTextColor(),
                               cp.getDisabledTextColor()) &&
              Utilities.equals(getActiveButtonColor(),
                               cp.getActiveButtonColor()) &&
              Utilities.equals(getInactiveButtonColor(),
                               cp.getInactiveButtonColor()) &&
              Utilities.equals(getDisabledButtonColor(),
                               cp.getDisabledButtonColor()) &&
              Utilities.equals(getActiveButtonTextColor(),
                               cp.getActiveButtonTextColor()) &&
              Utilities.equals(getInactiveButtonTextColor(),
                               cp.getInactiveButtonTextColor()) &&
              Utilities.equals(getDisabledButtonTextColor(),
                               cp.getDisabledButtonTextColor()) &&
              Utilities.equals(getActiveBrightTextColor(),
                               cp.getActiveBrightTextColor()) &&
              Utilities.equals(getInactiveBrightTextColor(),
                               cp.getInactiveBrightTextColor()) &&
              Utilities.equals(getDisabledBrightTextColor(),
                               cp.getDisabledBrightTextColor()) &&
              Utilities.equals(getActiveLightColor(),
                               cp.getActiveLightColor()) &&
              Utilities.equals(getInactiveLightColor(),
                               cp.getInactiveLightColor()) &&
              Utilities.equals(getDisabledLightColor(),
                               cp.getDisabledLightColor()) &&
              Utilities.equals(getActiveMidlightColor(),
                               cp.getActiveMidlightColor()) &&
              Utilities.equals(getInactiveMidlightColor(),
                               cp.getInactiveMidlightColor()) &&
              Utilities.equals(getDisabledMidlightColor(),
                               cp.getDisabledMidlightColor()) &&
              Utilities.equals(getActiveDarkColor(),
                               cp.getActiveDarkColor()) &&
              Utilities.equals(getInactiveDarkColor(),
                               cp.getInactiveDarkColor()) &&
              Utilities.equals(getDisabledDarkColor(),
                               cp.getDisabledDarkColor()) &&
              Utilities.equals(getActiveMidColor(),
                               cp.getActiveMidColor()) &&
              Utilities.equals(getInactiveMidColor(),
                               cp.getInactiveMidColor()) &&
              Utilities.equals(getDisabledMidColor(),
                               cp.getDisabledMidColor()) &&
              Utilities.equals(getActiveShadowColor(),
                               cp.getActiveShadowColor()) &&
              Utilities.equals(getInactiveShadowColor(),
                               cp.getInactiveShadowColor()) &&
              Utilities.equals(getDisabledShadowColor(),
                               cp.getDisabledShadowColor()) &&
              Utilities.equals(getActiveHighlightColor(),
                               cp.getActiveHighlightColor()) &&
              Utilities.equals(getInactiveHighlightColor(),
                               cp.getInactiveHighlightColor()) &&
              Utilities.equals(getDisabledHighlightColor(),
                               cp.getDisabledHighlightColor()) &&
              Utilities.equals(getActiveHighlightedTextColor(),
                               cp.getActiveHighlightedTextColor()) &&
              Utilities.equals(getInactiveHighlightedTextColor(),
                               cp.getInactiveHighlightedTextColor()) &&
              Utilities.equals(getDisabledHighlightedTextColor(),
                               cp.getDisabledHighlightedTextColor()) &&
              Utilities.equals(getActiveLinkColor(),
                               cp.getActiveLinkColor()) &&
              Utilities.equals(getInactiveLinkColor(),
                               cp.getInactiveLinkColor()) &&
              Utilities.equals(getDisabledLinkColor(),
                               cp.getDisabledLinkColor()) &&
              Utilities.equals(getActiveLinkVisitedColor(),
                               cp.getActiveLinkVisitedColor()) &&
              Utilities.equals(getInactiveLinkVisitedColor(),
                               cp.getInactiveLinkVisitedColor()) &&
              Utilities.equals(getDisabledLinkVisitedColor(),
                               cp.getDisabledLinkVisitedColor()));
    }
    return false;
  }

  /**
   * {@inheritDoc}
   */
  public int hashCode() { // NOPMD
    int hashCode = 179;
    String name = getName();
    if (name != null) {
      hashCode = 43 * hashCode + name.hashCode();
    }
    Color c = getActiveBackgroundColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveBackgroundColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveBackgroundColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledBackgroundColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveForegroundColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveForegroundColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledForegroundColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveBaseColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveBaseColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledBaseColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveAlternateBaseColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveAlternateBaseColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledAlternateBaseColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveTextColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveTextColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledTextColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveButtonColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveButtonColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledButtonColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveButtonTextColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveButtonTextColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledButtonTextColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveBrightTextColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveBrightTextColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledBrightTextColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveLightColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveLightColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledLightColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveMidlightColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveMidlightColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledMidlightColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveDarkColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveDarkColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledDarkColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveMidColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveMidColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledMidColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveShadowColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveShadowColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledShadowColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveHighlightColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveHighlightColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledHighlightColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveHighlightedTextColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveHighlightedTextColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledHighlightedTextColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveLinkColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveLinkColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledLinkColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getActiveLinkVisitedColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getInactiveLinkVisitedColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    c = getDisabledLinkVisitedColor();
    if (c != null) {
      hashCode = 43 * hashCode + c.hashCode();
    }
    return hashCode;
  }

  /**
   * {@inheritDoc}
   */
  public String toString() {
    return getName();
  }

}
